// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.meego 1.0


Image {
    id: pageHeader
    property string title : "VDM"
    property alias text_size: header.font.pixelSize
    property bool adLoading: false
    property alias value: progressbar.value
    signal adLoad_Ok;
    width: 200
    height: 50
    function loading(){
        console.debug("[Header] BusyIndicator running")
        busyindicator.visible = true;
        busyindicator.opacity = 1;
        busyindicator.running = true;
    }
    function finish(){
        console.debug("[Header] BusyIndicator stopped")
        busyindicator.opacity = 0;
        busyindicator.running = false
        busyindicator.visible = false;
    }
    source: "image://theme/meegotouch-view-header-fixed" + (theme.inverted ? "-inverted" : "")
    z: 1
    Label {
        id: header
        anchors {
            verticalCenter: parent.verticalCenter
            left: parent.left
            leftMargin: 16
        }
        platformStyle: LabelStyle {
            fontFamily: "Nokia Pure Text Light"
            fontPixelSize: 32
        }
        text: pageHeader.title
    }
    BusyIndicator {
        id: busyindicator
        width: 30
        height: 30
        visible: false
        anchors.right: parent.right
        anchors.rightMargin: 30
        anchors.verticalCenter: parent.verticalCenter
        opacity: 0;
        Behavior on opacity { NumberAnimation { duration: 600 }}
    }

    ProgressBar {
        id: progressbar
        height: 10
        width: 10
        anchors.left: busyindicator.right
        anchors.leftMargin: 0
        anchors.right: busyindicator.left
        anchors.rightMargin: 0
        anchors.top: busyindicator.bottom
        anchors.topMargin: 1
        minimumValue: 0
        maximumValue: 1
        Behavior on opacity { NumberAnimation { duration: 600 }}

    }

}
